﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QL_Nha_Sach_Phuong_Nam
{
    public partial class FormQuanLyHoaDon : Form
    {
        private CXulyHoaDon xuly_hoadon;

        public FormQuanLyHoaDon()
        {
            InitializeComponent();
        }

        private void FormQuanLyHoaDon_Load(object sender, EventArgs e)
        {
            xuly_hoadon = new CXulyHoaDon();

            HienThidsHoaDon(xuly_hoadon.getdsHoaDon());
        }

        private void HienThidsHoaDon(List<HoaDon> hoadons)
        {
            lvHoaDon.Items.Clear();
            foreach (HoaDon hd in hoadons)
            {
                ListViewItem lvi = lvHoaDon.Items.Add(hd.HoaDonNo);
                lvi.SubItems.Add(hd.HoaDonDate.Value.ToShortDateString());
                foreach (ChiTietHoaDon cthd in hd.ChiTietHoaDons)
                {
                    lvi.SubItems.Add(cthd.ChiTietHoaDonTotal.ToString());
                    break;
                }
            }
        }

        private void btnTimHoaDon_Click(object sender, EventArgs e)
        {

        }
    }
}
